package com.ruiysoft.service.statement.consts;



public enum StatementType {
	income(1, "收入"), expenditure (2, "支出");

	private int index;
	private String name;

	private StatementType(int index, String name) {
		this.index = index;
		this.name = name;
	}

	public static String getName(int index) {
		for (StatementType s : StatementType.values()) {
			if (s.getIndex() == index) {
				return s.getName();
			}
		}
		return null;
	}
	public static StatementType getEnum(int index) {
		for (StatementType s : StatementType.values()) {
			if (s.getIndex() == index) {
				return s;
			}
		}
		return null;
	}
	public int getIndex() {
		return this.index;
	}

	public String getName() {
		return this.name;
	}
}
